package com.ruoyi.webs.utils;


import java.util.TimerTask;
import javax.servlet.ServletContext;

import com.ruoyi.webs.utils.baiduocr.AuthService;
import com.ruoyi.common.utils.CacheUtils;


public class DelFileTask
        extends TimerTask {
//    @Autowired
//    private static HzPolicyInsuranceService hzPolicyInsuranceService;
    private static boolean isRunning = false;
    private ServletContext context = null;


    public DelFileTask() {
    }


    public DelFileTask(ServletContext context) {
        this.context = context;
    }


    public void run() {
        if (!isRunning) {

            this.context.log("开始执行指定任务");


            String access_token = AuthService.getAuth();

            CacheUtils.put("access_token", access_token);


            isRunning = false;
            this.context.log("指定任务执行结束");
        } else {
            this.context.log("上一次任务执行还未结束");
        }
    }
}